﻿using System.Collections.Generic;
using System.Linq;
using System.Windows.Media.Imaging;
using System;
using WpfAnimatedGif;
using System.Security.Policy;
using System.Windows;
namespace PRJ1109.Pages
{
    public class UseEmotion
    {
        public List<Emoticon> emoticons=new List<Emoticon>();

        private Dictionary<string ,string> keyValuePairs = new Dictionary<string ,string>();

        public void InitializeEmoticons()
        {            
            var Path = System.Environment.CurrentDirectory;

            Emoticon JoyEmoticon = new Emoticon ("Joy", Path + @"\myemotion\joy.gif");

            Emoticon AngryEmoticon = new Emoticon ("Angry", Path + @"\myemotion\angry.gif");
            
            Emoticon CoverEmoticon = new Emoticon ("Cover", Path + @"\myemotion\Cover one's mouth verb.gif");
            
            Emoticon DemonEmoticon = new Emoticon ("Demon", Path + @"\myemotion\Demon.gif");
            
            Emoticon HappyEmoticon = new Emoticon ("Happy", Path + @"\myemotion\happy.gif");
            
            Emoticon HelloEmoticon = new Emoticon ("Hello", Path + @"\myemotion\hello.gif");
            
            Emoticon OKEmoticon = new Emoticon ("OK", Path + @"\myemotion\OK.gif");
            
            Emoticon ProudEmoticon = new Emoticon ("Proud", Path + @"\myemotion\proud.gif");
            
            Emoticon ScareEmoticon = new Emoticon ("Scare", Path + @"\myemotion\score.gif");
            
            Emoticon ShyEmoticon = new Emoticon ("Shy", Path + @"\myemotion\shy.gif");
            
            Emoticon SleepEmoticon = new Emoticon ("Sleep", Path + @"\myemotion\sleep.gif");
            Emoticon TrytounderstandEmoticon = new Emoticon ("TrytounderstandEmoticon", Path + @"\myemotion\try to understand.gif");
            Emoticon HopeEmoticon = new Emoticon ("Hope", Path + @"\myemotion\Hope.gif");
            //添加到字典中
            emoticons.Add(JoyEmoticon);
            emoticons.Add(AngryEmoticon);
            emoticons.Add(DemonEmoticon);
            emoticons.Add(HappyEmoticon);
            emoticons.Add(CoverEmoticon);
            emoticons.Add(HelloEmoticon);
            emoticons.Add(OKEmoticon);
            emoticons.Add(ProudEmoticon);
            emoticons.Add(ScareEmoticon);
            emoticons.Add(ShyEmoticon);
            emoticons.Add(SleepEmoticon);
            emoticons.Add(TrytounderstandEmoticon);
            emoticons.Add(HopeEmoticon);
        }

        public string GetEmoticonImagePath(string emoticonName)
        {
            Emoticon emoticon = emoticons.FirstOrDefault(e => e.Name == emoticonName);
            return emoticon?.ImagePath;
        }


    }
}
